export function numberOfExitsOpt(data) {
  return {
    grid: {
      left: '5%',
      right: '5%',
      top: '10%',
      bottom: '8%',
    },
    xAxis: {
      type: 'category',
      data: data.name,
      axisLabel: {
        interval: 0
      }
    },
    yAxis: {
      type: 'value'
    },
    series: [
      {
        data: data.value,
        type: 'bar',
        barWidth: '30%',
      }
    ]
  };
}
export function twoBarECharts(data) {
  return {
    grid: {
      left: '5%',
      right: '5%',
      top: '10%',
      bottom: '15%',
    },
    legend: {
      left: 'center',
      bottom: 0,
      data: ['主合同金额', '补充合同金额']
    },
    xAxis: {
      type: 'category',
      data: data.name
    },
    yAxis: {
      type: 'value'
    },
    series: [
      {
        name: '主合同金额',
        data: data.value,
        type: 'bar'
      },
      {
        name: '补充合同金额',
        data: data.value,
        type: 'bar'
      },
    ]
  };
}

export function barAndLineECharts(data) {
  return {
    grid: {
      left: '5%',
      right: '5%',
      top: '10%',
      bottom: '8%',
    },
    xAxis: {
      type: 'category',
      data: data.name
    },
    yAxis: {
      type: 'value'
    },
    series: [
      {
        data: data.value,
        type: 'bar'
      },
      {
        data: data.value,
        type: 'line'
      }
    ]
  };
}

export function exitRatioOpt(data) {
  return {
    tooltip: {
      trigger: 'item'
    },
    legend: {
      orient: 'horizontal',
      left: 'center',
      bottom: '0'
    },
    series: [
      {
        name: 'Access From',
        type: 'pie',
        radius: '50%',
        data: data,
        emphasis: {
          itemStyle: {
            shadowBlur: 10,
            shadowOffsetX: 0,
            shadowColor: 'rgba(0, 0, 0, 0.5)'
          }
        }
      }
    ]
  };
}